package com.pro.control;

import com.pro.entity.ApplyRecordPuls;
import com.pro.entity.JsonData;
import com.pro.service.CreatorServie;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author ：刘弘禹
 * @description：TODO
 * @date ：2021/11/30 20:51
 */
@Controller
@RequestMapping("/Creator")
public class CreatorController {
    @Autowired
    private CreatorServie creatorServie;

    @RequestMapping("/queryApplyRecord")
    @ResponseBody
    public JsonData queryApplyRecord(ApplyRecordPuls applyRecordPuls) {
        List<ApplyRecordPuls> applyRecordPuls1 = creatorServie.queryApplyRecord(applyRecordPuls);
        return applyRecordPuls1 != null ? JsonData.buildSuccess(applyRecordPuls1) : JsonData.buildError("服务器错误");
    }

    @RequestMapping("/reviewApplication")
    @ResponseBody
    public JsonData reviewApplication(ApplyRecordPuls applyRecordPuls,String state) {
        Boolean aBoolean = creatorServie.reviewApplication(applyRecordPuls,state);
        return aBoolean != null ? JsonData.buildSuccess(aBoolean) : JsonData.buildError("服务器错误");
    }
}
